@echo off

::编译前准备
if exist build (
    echo build dir exists, clean it
    RD /S /Q build
)

echo make build dir
mkdir build
copy /b /y nul build\.gitkeep

if exist out (
    echo out dir exists, clean it
    RD /S /Q out
)

echo make out dir
mkdir out
copy /b /y nul out\.gitkeep


::开始编译
cd build
cmake -G "NMake Makefiles" ..
nmake
cd ..

::编译后动作
if exist build\p_relay.uf2 (
    xcopy build\p_relay.uf2 out\
)
